import type { PositionDetailApiResponse, PositionDetailRequest, PositionListQuery, PositionListResponse } from "./type"
import { request } from "@/http/axios"

export function getStudentPositionListApi(params: PositionListQuery) {
  return request<PositionListResponse>({
    url: "/position/student/page",
    method: "post",
    data: params
  })
}
export function createPositionApplicationApi(body: PositionDetailRequest) {
  return request({
    url: "/internship/student/positions/apply",
    method: "post",
    data: body
  })
}

export function getPositionDetailApi(params: PositionDetailRequest) {
  return request<PositionDetailApiResponse>({
    url: `/position/student/detail/${params.positionId}`,
    method: "get",
    params: {
      userId: params.userId
    }
  })
}
